//
//  ACEMyPayWayCell.m
//  ACE
//
//  Created by zhangtao on 2018/8/14.
//  Copyright © 2018年 zt.td. All rights reserved.
//

#import "ACEMyPayWayCell.h"

@implementation ACEMyPayWayCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
   
    
}

-(void)setColors:(NSArray *)colors{
        UIView *gradientView = [[UIView alloc]initWithFrame:CGRectMake(10, 0, ACEWidth-20, (ACEWidth-20)/3)];
    
    [self addSubview:gradientView];
    //渐变色承接视图
    //创建CAGradientLayer 对象
    CAGradientLayer *gradientLayer = [CAGradientLayer layer];
    //设置CAGradientLayer 对象的位置大小和承接视图等同
    gradientLayer.frame = gradientView.frame;
    //设置渐变色(即颜色数组)
    gradientLayer.colors = colors;
//    @[(id)HEXCOLOR(0xF8D79F).CGColor,
//      //      (id)RGB(249, 167, 175, 1).CGColor,
//      (id)HEXCOLOR(0xFE68C2).CGColor];
    
    //变化位置或变化点
    gradientLayer.locations = @[@(0.0f)];
    //渐变方向
    gradientLayer.startPoint = CGPointMake(0, 0);
    gradientLayer.endPoint = CGPointMake(1, 0);
    //添加
    [gradientView.layer addSublayer:gradientLayer];
}

- (IBAction)selectBtn:(UIButton *)sender {
    sender.selected = !sender.selected;
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    if (selected == YES) {
        _selectBtn.selected = YES;
    }else{
        _selectBtn.selected = NO;
    }
 
}

@end
